package com.hyh.logback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * logback 日志封装
 * 
 * @ClassName: LogCvt
 * @Description: TODO
 * @author share
 * @create-date 2012-10-9 上午09:27:30
 * @modify-date 2012-10-9 上午09:27:30
 *
 */
public class LogCvt {

	private static final Logger logger = LoggerFactory.getLogger("com.hyh.logback.logback");

	public Logger getLogger() {
		return logger;
	}

	// Log a message at the INFO level.
	public static void info(String msg) {
		logger.info(msg);
	}
	
	// Log a message at the INFO level.
	public static void info(String msg, Object...args) {
		logger.info(msg, args);
	}
	
	// Log an exception (throwable) at the INFO level with an accompanying
	// message.
	public static void info(String msg, Throwable t) {
		logger.info(msg, t);
	}

	// Log a message at the DEBUG level.
	public static void debug(String msg) {
		logger.debug(msg);
	}

	// Log an exception (throwable) at the DEBUG level with an accompanying
	// message.
	public static void debug(String msg, Throwable t) {
		logger.debug(msg, t);
	}

	// Log a message at the WARN level.
	public static void warn(String msg) {
		logger.warn(msg);
	}

	// Log a message at the WARN level.
	public static void warn(String msg, Throwable t) {
		logger.warn(msg, t);
	}

	// Log a message at the ERROR level.
	public static void error(String msg) {
		logger.error(msg);
	}

	public static void error(String msg, Throwable t) {
		logger.error(msg, t);
	}

	// -------------------------LogBack
	// Warn--------------------------------------------
	// Log a message at the TRACE level.
	public static void trace(String msg) {
		logger.trace(msg);
	}

	// Log an exception (throwable) at the TRACE level with an accompanying
	// message.
	public static void trace(String msg, Throwable t) {
		logger.trace(msg, t);
	}
	
}
